package soar.test.thread.queue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Sender implements Runnable
{
    private final static Logger logger = LoggerFactory.getLogger(Sender.class);

    public Sender() throws Exception
    {
    }

    public void run()
    {
        for (int i = 0; i < 100; ++i)
        {
            try
            {
                Request request = new Request();
                request.id = i;
                request.name = "";

                Receiver.enqueue(request);

                logger.info("send: {}", i);
            }
            catch (Exception e)
            {
                logger.info("send fail: {}", e);
            }
        }
    }
}
